![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
Class for male hares. More...
#include <hare_all.h>
Public Member Functions | |
virtual void | BeginStep (void) |
BeginStep for Hare_Male. More... | |
virtual void | Step (void) |
Step for Hare_Male. More... | |
virtual void | EndStep (void) |
EndStep code for Hare_Male. More... | |
Hare_Male (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight, int a_age, int a_Ref) | |
Constructor. More... | |
void | ReInit (struct_Hare a_data) |
Male object reinitiation. More... | |
void | Init (double p_weight, int a_age, int a_Ref) |
Object initiation. More... | |
virtual | ~Hare_Male () |
Destructor. More... | |
virtual void | ON_Dead () |
![]() | |
Hare_Juvenile (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight) | |
Constructor for the juvenile hare object. More... | |
void | ReInit (struct_Hare a_data) |
Juvenile object reinitiation. More... | |
void | Init (double p_weight) |
Object initiation. More... | |
virtual | ~Hare_Juvenile () |
Destructor for the juvenile hare object. More... | |
![]() | |
THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Constructor. More... | |
void | THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM) |
Object Initiation. More... | |
virtual | ~THare () |
Destructor. More... | |
double | GetWeight () |
double | GetTotalWeight () |
Provide the wet weight of the hare. More... | |
int | GetAge () |
void | ON_MumDead (Hare_Female *a_Mum) |
Inform Mum that we are dead. More... | |
void | SetMum (Hare_Female *) |
Set the mother pointer. Reimplemented in Hare_Infant. More... | |
Hare_Female * | GetMum () |
Get the mother pointer. More... | |
double | GetRMR () |
Get todays RMR. More... | |
int | GetRefNum () |
Get the refnum for this hare. More... | |
void | loadVegPalatability (void) |
Loads static member m_vegPalatability with data. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Protected Member Functions | |
TTypeOfHareState | st_Developing () |
Male Development. More... | |
TTypeOfHareState | st_Foraging () |
Male Foraging. More... | |
TTypeOfHareState | st_Resting () |
Male Resting. More... | |
TTypeOfHareState | st_ReproBehaviour () |
Currently Unused. More... | |
virtual void | InternalPesticideHandlingAndResponse () |
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralEndocrineDisruptor (double) |
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralOrganoPhosphate (double) |
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
![]() | |
TTypeOfHareState | st_Developing () |
The development code for Hare_Juvenile. More... | |
TTypeOfHareState | st_Dispersal () |
Juvenile Dispersal. More... | |
TTypeOfHareState | st_Foraging () |
Juvenile foraging. More... | |
void | st_NextStage () |
Maturation to Hare_Male or Hare_Female. More... | |
TTypeOfHareState | st_Resting () |
Juvenile Resting. More... | |
bool | ShouldMature () |
Test for maturation. More... | |
virtual bool | WasPredated () |
Test for mortality. More... | |
![]() | |
bool | Run (int a_dist, int a_direction) |
Run a distance in a direction. More... | |
void | EnergyBalance (TTypeOfActivity a_activity, int dist) |
Adjust energy balance for an activity. More... | |
void | TimeBudget (TTypeOfActivity a_activity, int dist) |
Adjust time budger for an activity. More... | |
void | st_Dying () |
Tidy up before removing the object on death. More... | |
virtual void | Running (int a_max_dist) |
Run. More... | |
void | Walking (int a_dist, int a_direction) |
Walking. More... | |
double | Forage (int &time) |
Foraging. More... | |
double | ForageP (int &time) |
Foraging but also incorporating pesticide exposure. More... | |
double | ForageSquare (int a_x, int a_y) |
Forage from an area. More... | |
double | ForageSquareP (int a_x, int a_y, double *a_pestexposure) |
Forage from an area and resturn pesticide exposure as well as food. More... | |
int | GetPegDistance () |
Get peg distance. More... | |
int | GetPegPull () |
Get attractive force of peg. More... | |
int | GetPegDirection () |
Get direction of peg. More... | |
void | MovePeg () |
Move the peg according to attraction forces. More... | |
bool | OnFarmEvent (FarmToDo event) |
Do we require a response to a farm event. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
static double * | m_vegPalatability = NULL |
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More... | |
![]() | |
TTypeOfHareState | m_CurrentHState |
Defines the current activity. More... | |
int | m_Age |
State variale - hare age. More... | |
Hare_Object | m_Type |
State variale - the type of hare. More... | |
double | m_weight |
State variale - hare weight g. More... | |
double | m_old_weight |
State variale - last hare weight. More... | |
Hare_Female * | m_MyMum |
Pointer to the hare's mum. More... | |
THare_Population_Manager * | m_OurPopulationManager |
Pointer to the hare population manager. More... | |
int | m_Lifespan |
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More... | |
int | m_ActivityTime |
Minutes of potential activity time per day. More... | |
int | m_StarvationDays |
State variable - the number of consecutive days in negative energy balance. More... | |
double | m_fatReserve |
State variable - the energy reserve of the hare. More... | |
double | m_TodaysEnergy |
State variable - the amount of energy available today, can be in deficit. More... | |
double | m_EnergyMax |
State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More... | |
double | m_KJRunning |
KJ/m cost of running per kg hare. More... | |
double | m_KJWalking |
KJ/m cost of walking per kg hare. More... | |
double | m_KJForaging |
KJ/m cost of foraging per kg hare. More... | |
double | m_SpeedRunning |
m/min speed of running per kg hare More... | |
double | m_SpeedWalking |
m/min speed of walking per kg hare More... | |
double | m_foragingenergy |
Energy obtained from foraging/feeding. More... | |
int | m_peg_x |
peg x-coordinate More... | |
int | m_peg_y |
peg y-coordinate More... | |
int | m_RefNum |
Unique hare reference number, also functions as sex flag. More... | |
int | m_experiencedDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_lastYearsDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_ddindex |
State variable used in alternative density-dependent configurations. More... | |
int | m_expDensity [365] |
State variable used in alternative density-dependent configurations. More... | |
int | m_DensitySum |
State variable used in alternative density-dependent configurations. More... | |
bool | m_IamSick |
flag for sickness - used in conjunction with disease configurations More... | |
double | m_pesticide_burden |
State variable used to hold the current body-burden of pesticide. More... | |
double | m_pesticidedegradationrate |
State variable used to hold the daily degredation rate of the pesticide in the body. More... | |
bool | m_pesticideInfluenced1 |
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
Class for male hares.
Hare_Male::Hare_Male | ( | int | p_x, |
int | p_y, | ||
Landscape * | p_L, | ||
THare_Population_Manager * | p_PPM, | ||
double | p_weight, | ||
int | a_age, | ||
int | a_Ref | ||
) |
Constructor.
Hare_Male constructor.
References Init().
|
virtual |
|
virtual |
BeginStep for Hare_Male.
Resets the day's activity counter and checks for default mortalities and potentially extra mortalities. Calculates energy usage for movement based on todays weight.
Also contains optional code designed to test for disease and size related death probabilities - part of the POM exercise
Unlike younger classes this method also tests for reaching the end of physiological lifespan
Reimplemented from Hare_Juvenile.
References cfg_hare_escape_dist, cfg_hare_minimum_breeding_weight, cfg_hare_proximity_alert, cfg_HareFemaleSicknessDensityDepValue, cfg_MaxEnergyIntakeScaler, TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, THare::m_Age, THare::m_ddindex, THare::m_DensitySum, THare::m_EnergyMax, THare::m_expDensity, THare::m_experiencedDensity, THare::m_foragingenergy, THare::m_IamSick, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, THare::m_lastYearsDensity, THare::m_Lifespan, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, ON_Dead(), random(), THare::Running(), Landscape::SupplyDayInYear(), CfgInt::value(), CfgFloat::value(), and Hare_Juvenile::WasPredated().
|
virtual |
EndStep code for Hare_Male.
In EndStep, the home-range centre peg gravitates a little way towards the daily activity area for today.
Reimplemented from Hare_Juvenile.
References cfg_hare_pesticideresponse_on, InternalPesticideHandlingAndResponse(), THare::MovePeg(), and CfgBool::value().
|
protectedvirtual |
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.
Reimplemented from THare.
Referenced by InternalPesticideHandlingAndResponse().
|
protectedvirtual |
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.
Reimplemented from THare.
References g_rand_uni, l_pest_daily_mort, THare::m_CurrentHState, TALMaSSObject::m_StepDone, tohs_Dying, and CfgFloat::value().
Referenced by InternalPesticideHandlingAndResponse().
void Hare_Male::Init | ( | double | p_weight, |
int | a_age, | ||
int | a_Ref | ||
) |
Object initiation.
References hob_Male, THare::m_Age, THare::m_fatReserve, THare::m_RefNum, THare::m_Type, and THare::m_weight.
Referenced by Hare_Male(), and ReInit().
|
protectedvirtual |
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.
This method is re-implemented ffrom THare for any class which has pesticide response behaviour. If the body burden exceeds the trigger then call pesticide-specific actions by dose
Reimplemented from THare.
References THare_Population_Manager::BodyBurdenOut(), cfg_HarePesticideAccumulationThreshold, GeneralEndocrineDisruptor(), GeneralOrganoPhosphate(), TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_pesticide_burden, THare::m_pesticidedegradationrate, THare::m_weight, Landscape::SupplyDayInYear(), Landscape::SupplyPesticideType(), Landscape::SupplyYearNumber(), ttop_AcuteEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and CfgFloat::value().
Referenced by EndStep().
|
virtual |
Minimal housekeeping for dying for the male
Reimplemented from Hare_Juvenile.
References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TALMaSSObject::m_StepDone, and tohs_Dying.
Referenced by BeginStep(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingGrid(), and Step().
void Hare_Male::ReInit | ( | struct_Hare | a_data | ) |
Male object reinitiation.
References struct_Hare::age, struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, struct_Hare::RefNum, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by THare_Population_Manager::CreateObjects().
|
protected |
Male Development.
References activity_Resting, cfg_adult_starvation_threshold, cfg_adult_starve, cfg_AdultMaxFat, cfg_fixadult_starve, cfg_juv_starve, THare::EnergyBalance(), THare_Population_Manager::GetGrowthEfficiencyF(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyF(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_fatReserve, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, random(), tohs_Dispersal, tohs_Dying, tohs_Foraging, CfgInt::value(), and CfgFloat::value().
Referenced by Step().
|
protected |
Male Foraging.
Foraging code for the Hare_Male.
Foraging time is reduced dependent upon the density of hares in the local area. There are a number of options for calculting this effect used in the POM
References activity_Foraging, cfg_ForageRestingRatio, cfg_hare_pesticideresponse_on, THare::Forage(), THare::ForageP(), g_rand_uni, THare_Population_Manager::GetAdultDensity(), THare_Population_Manager::GetDelayedAdultDensity(), THare_Population_Manager::GetInterference(), THare::m_ActivityTime, THare_Population_Manager::m_HareThresholdDD, THare::m_lastYearsDensity, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Dispersal, tohs_Resting, CfgFloat::value(), and CfgBool::value().
Referenced by Step().
|
protected |
Currently Unused.
References tohs_Resting.
Referenced by Step().
|
protected |
Male Resting.
This method uses up the rest of the day in resting
References tohs_Developing.
Referenced by Step().
|
virtual |
Step for Hare_Male.
Step controls all the state/transition behaviour for the male hare.
Has some optional code for dispersal related mortality for use in POM testing.
Reimplemented from Hare_Juvenile.
References cfg_hare_adult_predation, g_rand_uni, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, ON_Dead(), st_Developing(), Hare_Juvenile::st_Dispersal(), st_Foraging(), st_ReproBehaviour(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_ReproBehaviour, tohs_Resting, CfgFloat::value(), and Landscape::Warn().